// 圆的面积和直径
#include <iostream>

#include <math.h>

int main() {
    using std::cout;
    cout << "\n输入圆半径:";

    using std::cin;
    float radius;
    cin >> radius;

    float area_circle = M_PI * pow(radius, 2);
    float diameter = 2 * radius;

    cout << "\n圆的面积是 " << area_circle;
    cout << "\n圆的直径是 " << diameter;
}

// g++ -fexec-charset=GBK ch02/2_12.cpp && ./a